package itsm.isperp.module.dto.app;

import itsm.isperp.framework.domain.IUser;
import itsm.isperp.framework.domain.UserStatus;

import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Id;

import org.apache.commons.lang3.StringUtils;
import org.springframework.security.core.GrantedAuthority;

/**
 * 
 * 
 * 
 * @author lizx
 * @date 2014-12-7
 * @since 1.0
 * 
 */
public class VUserAccount implements IUser {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	String id;
	@Column
	String name;
	@Column
	String password;
	@Column
	String fullname;
	@Column
	String position;
	@Column
	String tel;
	@Column
	String mobile;
	@Column
	String email;
	@Column
	String photo;
	@Column
	boolean enable;
	@Column
	String department;
	@Column
	String uType;

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	@Override
	public String getId() {
		return id;
	}

	@Override
	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String getPassword() {
		return password;
	}

	@Override
	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public String getFullname() {
		return fullname;
	}

	public void setFullname(String fullname) {
		this.fullname = fullname;
	}

	@Override
	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@Override
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Override
	public String getEmail() {
		return email;
	}

	@Override
	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	public boolean getEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	public String getuType() {
		return uType;
	}

	public void setuType(String uType) {
		this.uType = uType;
	}

	@Override
	public String getFirstName() {
		return this.name;
	}

	@Override
	public String getLastName() {
		return this.name;
	}

	@Override
	public boolean isPictureSet() {
		return StringUtils.isNotEmpty(this.photo);
	}

	@Override
	public void setFirstName(String arg0) {
		this.name = arg0;
	}

	@Override
	public void setLastName(String arg0) {
		this.name = arg0;
	}

	@Override
	public Collection<? extends GrantedAuthority> getAuthorities() {
		return null;
	}

	@Override
	public String getUsername() {
		return this.name;
	}

	@Override
	public boolean isAccountNonExpired() {
		return this.enable;
	}

	@Override
	public boolean isAccountNonLocked() {
		return this.enable;
	}

	@Override
	public boolean isCredentialsNonExpired() {
		return false;
	}

	@Override
	public boolean isEnabled() {
		return this.enable;
	}

	@Override
	public UserStatus getUserStatus() {
		return null;
	}

}
